package com.liuyu2783.redislock.common;

import lombok.Data;

import java.util.Date;

/**
 * com.liuyu2783.redislock.common
 *
 * @author liuyu07
 * @date 2019-6-28
 */
@Data
public class MyResponse<T> {

    private String code = "200";
    private String message = "成功";
    private T data;
    private Date dateTime = new Date();

    public MyResponse(){}

    public MyResponse(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public MyResponse(String code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public MyResponse success(T data){
        return new MyResponse(code,message,data);
    }
}
